import Vue from 'vue'
import App from './App.vue'
import VueRouter from "vue-router"
// 一级目录 引入
import News from "./views/News.vue"
import Home from "./views/Home.vue"
import Sports from "./views/Sports.vue"
// 将二级目录引入
import SportsHome from "./components/SportsHome"
import SportsCountry from "./components/SportsCountry.vue"
import SportsForign from "./components/SportsForign"
const routes = [{
  path: "/home",
  component: Home
}, {
  path: "/news",
  component: News
}, {
  path: "/sports",
  component: Sports,
  children: [{
      path: "sportshome",
      component: SportsHome
    },
    {
      path: "sportscountry",
      component: SportsCountry
    }, {
      path: "sportsforign",
      component: SportsForign
    }
  ]
}]
// 创建路由对象 传入规则
const router = new VueRouter({
  routes
})
Vue.config.productionTip = false
Vue.use(VueRouter)
new Vue({
  render: h => h(App),
  router
}).$mount('#app')